package hongcaosp.app.android.modle.bean;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;

import hongcaosp.app.android.comment.IViewType;
import xlj.lib.android.base.utils.DateUtil;

public class Comment implements IComment {
//    {
//        "id": 4,视频id
//        "fatherCommentId": null,
//            "toUserId": null,
//            "videoId": null,
//            "fromUserId": null,
//            "status": null,
//            "likeCounts": null,
//            "getTime": 1543647079000,
//            "deleteStatus": null,
//            "getComment": "评论4",
//            "type": -1, //0回复，1转发
//            "commentsUser": {
//        "id": 4,
//                "image": null,
//                "nickname": "傅欢"
//    },
//        "secondUser":  {//对用户2
//        "id": 2,
//                "image": null,
//                "nickname": "张三丰"
//    },
//        "childCommentsCount": 1,//字评论数量
//            "childCommentsList": [ //默认查出一个字评论
//        {
//            "id": 5,
//                "fatherCommentId": null,
//                "toUserId": null,
//                "videoId": null,
//                "fromUserId": null,
//                "status": null,
//                "likeCounts": null,
//                "getTime": 1543647209000,
//                "deleteStatus": null,
//                "getComment": "转发评论4",
//                "type": 1,
//                "commentsUser": {
//            "id": 5,
//                    "userCode": null,
//                    "password": null,
//                    "userComment": null,
//                    "name": null,
//                    "birthday": null,
//                    "sex": null,
//                    "locality": null,
//                    "status": null,
//                    "type": null,
//                    "mobile": null,
//                    "email": null,
//                    "image": null,
//                    "nickname": "李海生",
//                    "fansCounts": null,
//                    "followCounts": null,
//                    "likeCounts": null,
//                    "collectionCounts": null,
//                    "getTime": null,
//                    "isVip": null,
//                    "vipLevel": null,
//                    "idNumber": null,
//                    "opendId": null,
//                    "token": null,
//                    "vipStartTime": null,
//                    "vipExpiration": null
//        },
//            "secondUser": null,
//                "childCommentsCount": null,
//                "childCommentsList": null
//        }
//]
//    }
    @JSONField(name = "id")
    private int id;
    @JSONField(name = "getTime")
    private long createTime;
    @JSONField(name = "commentsUser")
    private User commentsUser;
    private int videoId;

    private int type;
    private String comment;
    private User secondUser;
    private int likeCounts;
    @JSONField(name = "childCommentsCount")
    private int childCommentsCount;

    @JSONField(name = "childCommentsList")
    private List<CommentReply> childCommentsList;

    private boolean isLike;

    public int getVideoId() {
        return videoId;
    }

    public void setVideoId(int videoId) {
        this.videoId = videoId;
    }

    public int getChildCommentsCount() {
        return childCommentsCount;
    }

    public void setChildCommentsCount(int childCommentsCount) {
        this.childCommentsCount = childCommentsCount;
    }

    public List<CommentReply> getChildCommentsList() {
        return childCommentsList;
    }

    public void setChildCommentsList(List<CommentReply> childCommentsList) {
        this.childCommentsList = childCommentsList;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public User getCommentsUser() {
        return commentsUser;
    }

    public void setCommentsUser(User commentsUser) {
        this.commentsUser = commentsUser;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public User getSecondUser() {
        return secondUser;
    }

    public void setSecondUser(User secondUser) {
        this.secondUser = secondUser;
    }

    public int getLikeCounts() {
        return likeCounts;
    }

    public void setLikeCounts(int likeCounts) {
        this.likeCounts = likeCounts;
    }

    @Override
    public IUser user() {
        return commentsUser;
    }

    @Override
    public String comment() {
        return comment;
    }

    @Override
    public String commentTime() {
        return DateUtil.getChatTimeStr(createTime);
    }

    @Override
    public int viewType() {
        return IViewType.VIEWTYPE_COMMENT;
    }

    public boolean isLike() {
        return isLike;
    }

    public void setLike(boolean like) {
        isLike = like;
    }
}
